﻿using GrainManage.Entities.Image;
using GrainManage.Proxy.Util;
using System.Reflection;

namespace GrainManage.Proxy
{
    public sealed class ImageProxy : GrainManage.Interface.IImage
    {

        //************************************************POST************************************************

        public OutputGetImages GetImages(InputGetImages input)
        {
            var result = WebUtil.ExecuteByPost<OutputGetImages>(UrlUtil.Generate(MethodBase.GetCurrentMethod()), input);
            return result;
        }

        public OutputInsert Insert(InputInsert input)
        {
            var result = WebUtil.ExecuteByPost<OutputInsert>(UrlUtil.Generate(MethodBase.GetCurrentMethod()), input);
            return result;
        }

        public OutputUpdate Update(InputUpdate input)
        {
            var result = WebUtil.ExecuteByPost<OutputUpdate>(UrlUtil.Generate(MethodBase.GetCurrentMethod()), input);
            return result;
        }

        public OutputDelete Delete(InputDelete input)
        {
            var result = WebUtil.ExecuteByPost<OutputDelete>(UrlUtil.Generate(MethodBase.GetCurrentMethod()), input);
            return result;
        }

        public OutputBatchInsert BatchInsert(InputBatchInsert input)
        {
            var result = WebUtil.ExecuteByPost<OutputBatchInsert>(UrlUtil.Generate(MethodBase.GetCurrentMethod()), input);
            return result;
        }

        public OutputBatchUpdate BatchUpdate(InputBatchUpdate input)
        {
            var result = WebUtil.ExecuteByPost<OutputBatchUpdate>(UrlUtil.Generate(MethodBase.GetCurrentMethod()), input);
            return result;
        }

        public OutputBatchDelete BatchDelete(InputBatchDelete input)
        {
            var result = WebUtil.ExecuteByPost<OutputBatchDelete>(UrlUtil.Generate(MethodBase.GetCurrentMethod()), input);
            return result;
        }

        public OutputGetImageFile GetImageFile(InputGetImageFile input)
        {
            var result = WebUtil.ExecuteByPost<OutputGetImageFile>(UrlUtil.Generate(MethodBase.GetCurrentMethod()), input);
            return result;
        }

        public OutputGetImageUrl GetImageUrl(InputGetImageUrl input)
        {
            var result = WebUtil.ExecuteByPost<OutputGetImageUrl>(UrlUtil.Generate(MethodBase.GetCurrentMethod()), input);
            return result;
        }

        public byte[] DownLoad(InputDownLoad input)
        {
            var result = WebUtil.Execute(UrlUtil.Generate(MethodBase.GetCurrentMethod()), input);
            return result;
        }
    }
}
